<template>
	<view>
		<view class="tool">
			<block  v-for="item in toolList">
				<view class="tool_list" v-if="item.id != 5" :class="item.color" @click="gotoToolPage(item.id)">
					<image :src="item.icon" mode=""></image>
					<view class="tool_item_name">
						{{item.title}}
					</view>
				</view>
				<view class="tool_list" v-if="item.id == 5  && givenumber == 1" :class="item.color" @click="gotoToolPage(item.id)">
					<image :src="item.icon" mode=""></image>
					<view class="tool_item_name">
						{{item.title}}
					</view>
				</view>
			</block>
			
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				givenumber:1,
				toolList: [{
						id: "1",
						title: '毕孚模块自查',
						icon: '/static/toolSet/transformer@2x.png',
						color: 'one'
					},
					{
						id: "2",
						title: '风资源速查',
						icon: '/static/toolSet/Windfarm@2x.png',
						color: 'one'
					},
					{
						id: "3",
						title: '风电节能减排量计算',
						icon: '/static/toolSet/Windpower@2x.png',
						color: 'one'
					},
					{
						id: "4",
						title: '风电电缆查',
						icon: '/static/toolSet/Estimationofwindpowerconsumption@2x.png',
						color: 'one'
					},

					{
						id: "6",
						title: '全国风类区域查询',
						icon: '/static/toolSet/nationalwind@2x.png',
						color: 'one'
					},
					{
						id: "5",
						title: '来个号',
						icon: '/static/toolSet/Bigpressureonsmallyieldforecast@2x.png',
						color: 'one'
					},
					// {
					//   id: "7",
					//   title: '风场天气实时查询',
					//   icon: '/static/toolSet/Windfield@2x.png',
					//   color: 'one'
					// },
					// {
					//   id: "8",
					//   title: '潮汐浪高查询',
					//   icon: '/static/toolSet/tide@2x.png',
					//   color: 'one'
					// },
					// {
					//   id: "9",
					//   title: '电缆载流量查询',
					//   icon: '/static/toolSet/cable@2x.png',
					//   color: 'one'
					// },
				]
			};
		},
		onLoad() {
			console.log("来个号");
			console.log(this.$store.state.userinfo.givenumber);
			this.givenumber=this.$store.state.userinfo.givenumber;
		},
		methods: {
			// 跳转到对应的小工具集 页面
			gotoToolPage(id) {


				//  if(!this.$store.state.isLogin) return  this.$u.toast("请登录");
				if (id == 1) {
					uni.navigateTo({
						url: '/subpackage/tool/ioplc/ioplc'

					});
				} else if (id == 2) {
					uni.navigateTo({
						url: '/subpackage/tool/wind/wind'
					});
				} else if (id == 3) {
					uni.navigateTo({
						url: '/subpackage/tool/wind/windEnergy'
					});
				} else if (id == 4) {
					uni.navigateTo({
						url: '/subpackage/tool/windPowerChooseCable/windPowerChooseCable'
					});
				} else if (id == 5) {
					uni.navigateTo({
						url: '/subpackage/tool/givenumber/givenumber'
					});
				}
			}
		},
	}
</script>

<style lang="scss">
	.tool {
		display: flex;
		flex-wrap: wrap;
		justify-content: space-between;
		padding-left: 20rpx;
padding-right: 20rpx;
		.tool_list {
			margin-top: 15px;


			height: 90px;
			width: 40%;
			border: 1rpx solid #E5E5E5;
			display: flex;
			flex-direction: column;
			align-items: center;
			justify-content: center;

			image {
				margin-bottom: 10rpx;
				height: 100rpx;
				width: 100rpx;
			}

			.tool_item_name {
				font-size: 30rpx;
				color: #333333;
				font-weight: bold;
			}

		}
	}

	.one {
		background: linear-gradient(to bottom, #FFFFFF, 80%, #BDE0FF);
	}

	.two {
		background: linear-gradient(to bottom, #FFFFFF, 80%, #BDE0FF);
	}

	.one {
		background: linear-gradient(to bottom, #FFFFFF, 80%, #BDE0FF);
	}

	.one {
		background: linear-gradient(to bottom, #FFFFFF, 80%, #BDE0FF);
	}

	.one {
		background: linear-gradient(to bottom, #FFFFFF, 80%, #BDE0FF);
	}

	.one {
		background: linear-gradient(to bottom, #FFFFFF, 80%, #BDE0FF);
	}

	.one {
		background: linear-gradient(to bottom, #FFFFFF, 80%, #BDE0FF);
	}

	.one {
		background: linear-gradient(to bottom, #FFFFFF, 80%, #BDE0FF);
	}
</style>
